<?php

App::import('Controller', 'Users');
App::import('Model', 'User');

class USersControllerTest extends ControllerTestCase {
    public function startTest(){
    $this->Users = new UsersController();
    $this->Users->constructClasses();
    }
    public function testForgotpassword(){
        $forgot = $this->generate('Users', array(
        'components' => array(
            'Session',
            'Email' => array('send')
        )
    ));
        $forgot->Session
        ->expects($this->once())
        ->method('setFlash');
        $forgot->Email
        ->expects($this->once())
        ->method('send')
        ->will($this->returnValue(true));
        
        $this->testAction('/Users/forgotpassword', array(
        'data' => array(
            'Post' => array('name' => 'New Post')
        )
    ));
        $data='mina.farouj@gmail.com';
        $result = $this->testAction(
            '/users/forgotpassword',
            array('data' => $data, 'method' => 'post')
        );
        debug($result);
    }
}